#include<stdio.h>
#include<string.h>

int my_strlen(char* str) {
	//char tmp = *str;
	int count = 0;
	while (*str != '\0')
	{
		count++;
		str++;
	}
	return count;
}

void reverse(char* str) 
{
	char tmp = *str;
	int len = my_strlen(str);
	*str = *(str + len - 1);
	*(str + len - 1) = '\0';
	if (my_strlen(str + 1) >= 2) {
		reverse(str + 1);
	}
	*(str + len - 1) = tmp;
}

//int main() {
//	char arr[] =  "abcdefg";
//	reverse(arr);
//	printf("%s", arr);
//}

void reverse1(char str[], int left, int right) {
	char tmp = str[left];
	str[left] = str[right];
	str[right] = tmp;
	if(left+1<right-1)
	reverse1(str, left+1, right-1);

}

int main() {
	char arr[] = "abcdef";
	int left = 0;
	int right = my_strlen(arr) - 1;
	reverse1(arr, left, right);
	printf("%s", arr);
}